﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DotNetCSharp
{
    public partial class FuxiType
    {
        void MakeTurnDecision()
        {
            _outs = HandEvaluator.GetNumberOuts(_frameData.Pocket, _frameData.Board);
            switch (strategy)
            {
                case Strategy.Basic:
                    if (winOdds > 0.92 ||
                        winOdds > 0.85 && _handData.NumFuxiRaisedTurn == 0 ||
                        _handData.HavePosition && _handData.NumOppRaisedTurn == 0 && winOdds > 0.66 ||
                        !_handData.HavePosition && _handData.NumOppRaisedTurn == 0 && winOdds > 0.75 ||
                        _handData.NumFuxiRaisedFlop == 1 && shouldDbet && oppNeverRaised
                        )
                    {
                        _handData.NumFuxiRaisedTurn++;
                        ExecuteRaise();
                    }
                    else if (_handData.NumFuxiRaisedTurn == 0 && winOdds > 0.66 ||
                            _handData.NumFuxiRaisedTurn == 1 && winOdds > 0.70
                        )
                    {
                        ExecuteCall();
                    }
                    else if (_handData.FuxiDrawing ||
                            _outs > 10
                            )
                    {
                        ExecuteCall();
                    }
                    else
                    {
                        ExecuteCheck();
                    }
                    break;
                case Strategy.Trap:
                    if (!_turnCheckRaise &&
                        (winOdds > 0.92 ||
                        winOdds > 0.8 && _handData.NumFuxiRaisedTurn == 0 ||
                        _handData.HavePosition && _handData.NumOppRaisedTurn == 0 && winOdds > 0.66 ||
                        !_handData.HavePosition && _handData.NumOppRaisedTurn == 0 && winOdds > 0.75
                        )
                        )
                    {
                        _handData.NumFuxiRaisedTurn++;
                        _turnCheckRaised = true;
                        ExecuteRaise();
                    }
                    else if (winOdds > potOdds)
                    {
                        ExecuteCall();
                    }
                    else
                    {
                        ExecuteCheck();
                    }
                    break;
                default:
                    break;
            }

        }
    }
}
